package com.chenfan.mcn.model.dto;

import com.chenfan.common.extension.validation.groups.Modify;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * 红人月度结算单-HR计税DTO
 *
 * @author wulg
 * @date 2022-01-13
 **/
@Data
public class StarMonthlySettlementTaxDTO implements Serializable {

    private static final long serialVersionUID = 4593296515202621511L;

    /**
     * 结算单ID
     */
    @NotNull(message ="结算单ID不能为空")
    private Long settlementId;

    /**
     * 计税信息集合
     */
    @NotEmpty(message ="计税信息集合不能为空")
    private List<TaxInfo> taxInfoList;


    /**
     * 流程实例ID
     */
    @NotNull(message = "流程实例ID不能为空")
    private Long approvalId;

    /**
     * 计税信息
     */
    @Data
    public static class TaxInfo {

        /**
         * 子结算单ID
         */
        @NotNull(message ="子结算单ID不能为空", groups = {Modify.class})
        private Long subSettlementId;

        /**
         * 应扣税额
         */
        @NotNull(message ="应扣税额不能为空", groups = {Modify.class})
        private BigDecimal taxableAmount;
    }
}
